package com.sdp.lease.controller;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.sdp.core.bizc.db.Query;
import com.sdp.core.bizc.vo.DataCenter;
import com.sdp.core.bizc.vo.Result;
import com.sdp.lease.db.l_location_info.entity.LLocationInfo;
import com.sdp.lease.db.l_location_info.service.ILLocationInfoService;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author zsp
 * @since 2024-07-24
 */
@RestController
@RequestMapping("/LLocationInfoController")
public class LLocationInfoController {

	@Autowired
	private ILLocationInfoService iLLocationInfoService;
	
	@Autowired
	private Query query;
	
	@PostMapping(value = "/page")
	public Result<?> page(@RequestBody DataCenter dataCenter) {
//		String path = "D:/test.text";
//		try {
//			BufferedWriter writer = new BufferedWriter(new FileWriter(path));
//			String d = JSON.toJSONString(iLLocationInfoService.createLocationTreeSelect());
//			writer.write(d);
//			writer.close();
//		} catch (Exception e) {
//		}
		return Result.ok(query.page(iLLocationInfoService, LLocationInfo.class , dataCenter));
	}
}

